Resolve Issue #19: Remaining Audit Fixes - #23
Merged
Conversation
Collaborator
Author
|
/oc can you review this PR to confirm to resolves the last comments on the linked issue #19 |
Contributor
|
Based on my review of the PR changes, I can confirm this PR resolves the remaining items from Issue #19: Verified Resolutions:
Not Addressed in This PR:
The PR changes match the claims in the description and properly address the technical items. The staging buffer implementation is particularly important for GPU performance by avoiding the slow host-to-device memory path for large mesh data. |
This was referenced Jul 8, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR addresses the unresolved items from Issue #19 that were noted as "NOT RESOLVED". It builds upon the critical fixes by adding performance optimizations, test infrastructure, and further architectural improvements.
Fixes #19.
Addressed Issues
1. Monolithic App Struct
Appstruct by extracting subsystems:WindowManager(SDL/Context)RenderSystem(RHI/Resources)MapController(Map interaction/rendering logic) - New in this PRMenuContext(Menu UI logic)Appis now a focused orchestrator (~480 lines vs original >1000).2. Buffer Recreation on Mesh Update (P2)
src/world/chunk_mesh.zig.ChunkMeshnow tracks buffer capacity and reuses existing buffers if the new mesh fits, resizing only when necessary (using power-of-2 growth). This eliminates the costly destroy/create cycle on every update.3. Host-Visible Memory (P2)
src/engine/graphics/rhi_vulkan.zig.createBuffernow selectsDEVICE_LOCALmemory for vertex and index buffers.uploadBufferuses a temporary staging buffer to transfer data to the GPU, ensuring optimal rendering performance.4. No Testing Infrastructure
src/tests.zigwith unit tests and configured ateststep inbuild.zig. CI now runs these tests.5. Inefficient Chunk Rendering
World.render.render_distance.visible_chunkslist to optimize the double-pass (solid/fluid) rendering.Verification
zig build testpasses.zig build run -- --backend vulkanruns successfully.